#pragma once

typedef unsigned int uint;

struct tVector2
{
	float x;
	float y;
};

struct tVector3
{
	float x;
	float y;
	float z;
};

struct tVector4
{
	float x;
	float y;
	float z;
	float w;
};

struct tCharBuffer {

	char Buffer[48];
};

struct tMatrix4 {

	float m11, m12, m13, m14,
	m21, m22, m23, m24,
	m31, m32, m33, m34,
	m41, m42, m43, m44;
};

#define MAX_TEXTURE_BYTES 512
/*
21 is the current summation of all possible elements
*/
#define MESH_DATA_SIZE	(21 * sizeof(float) * 3 * 50)
#define PROCEDURAL_DATA_SIZE	128
#define PROCEDURAL_DATA_COOKIE_LENGTH	128

class HeaderStructs {
public:

	struct tSceneLight
	{
		tCharBuffer target;
		tVector3 color;
		float diffuse;
		float specular;
		float brightness;
		uint type;
		bool remove;
	};

	struct tGeometryPartHeader {
	
		uint triangleCount;
	};

	struct tGeometryHeader
	{
		tCharBuffer target;
		u_int vertexFormat;
		uint partCount;
		bool remove;
	};
	
	struct tParametersHeader
	{
		tCharBuffer target;
		uint partCount;
		bool isDeformation;
		bool isInstanceChild;
	};

	struct tChannelHeader {
		
		tCharBuffer samplers[5];
	};

	struct tParametersPartHeader {

		tCharBuffer shaderFilename;
		tChannelHeader channelColor;
		tChannelHeader channelNormal;
		tChannelHeader channelSpecular;
	};

	struct tInstanceSamplerHeader
	{
		tCharBuffer target;
		tCharBuffer targetChild;
		tCharBuffer channel;
		u_int type;
		bool remove;
	};

	struct tSurfaceTextureHeader
	{
		tCharBuffer target;
		tCharBuffer channel;
		tCharBuffer sampler;
		u_int partIndex;
		u_int type;
		bool remove;
	};

	struct tInstanceChildHeader
	{
		tCharBuffer child;
		tCharBuffer samplerPosition;
		tCharBuffer samplerScale;
		tCharBuffer samplerRotation;
		tCharBuffer cookieFilename;
	};

	struct tInstanceHeader
	{
		tCharBuffer target;
		uint instanceCount;
	};

	struct tDeformationHeader
	{
		tCharBuffer target;
		bool remove;
		float scale;
		u_int proceduralFormat;
	};
};

class DataStructs {

public:

	struct tTextureFile {

		u_int stage;
		char filename[MAX_TEXTURE_BYTES];
	};

	struct tNoise {

		float amplitude;
		u_int octaves;
		float scale;
		float offset;
	};

	struct tGrid {

		float contrast;
		float height;
		float width;
		tVector3 color_a;
		tVector3 color_b;
	};

	struct tChecker {

		float contrast;
		tVector3 color_a;
		tVector3 color_b;
	};

	struct tRamp {

		float wave;
	};

	struct tWood {

		float ageSpacing;
		float ageCount;
		tVector3 color_a;
		tVector3 color_b;
	};
};

class QuerysStructs {
public:

	struct tViewerInfoQuery
	{
		tCharBuffer target;
		int responceType;
	};

	struct tQueryHeader {

		tCharBuffer targetName;
		bool isPresent;
	};

	struct tChannelHeader {
		
		tCharBuffer samplers[5];
	};

	/*
	*/
	struct tGeometryHeader
	{
		int partCount;
		int vertexFormat;
	};

	struct tGeometryPartHeader
	{
		int triangeCount;
		tCharBuffer shader;
		tChannelHeader channel[3];
	};

	struct tInstancingHeader {

		bool isInstanced;
		int childCount;
	};

	struct tInstanceChildHeader {

		tCharBuffer name;
		tCharBuffer samplerPosition;
		tCharBuffer samplerRotation;
		tCharBuffer samplerScale;
		tCharBuffer filenameCookie;
	};

	struct tDeformationHeader {

		bool isDeformation;
		float scale;
	};

/*
	struct tViewerDeformationInfoResponce
	{
		bool remove;
		float scale;
		int proceduralFormat;
	};

	struct tViewerTextureInfoResponce
	{
		char textureFilenames[3][MAX_TEXTURE_BYTES];
	};

	struct tViewerParameterInfoResponce
	{
		char shaderFilename[MAX_TEXTURE_BYTES];
		int shaderFeatureSet;
		int inputFeatureSet;
		int sceneType;
	};

	struct tViewerInstanceInfoResponce
	{
		bool childExists;
		int childTotalCount;
		tCharBuffer childMesh;
		tProceduralData childProcedrual;
	};*/
};